package com.tuxing.draa_data.pojo.subject;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 学科-字典表
 * </p>
 *
 * @author yuanshihang
 * @since 2021-12-15
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("new_dc_subject_dict")
public class NewDcSubjectDict implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "SUB_ID",type = IdType.ASSIGN_ID)
    private Long subId;

    /**
     * 学科代码
     */
    @TableField("SUB_CODE")
    private String subCode;

    /**
     * 数值
     */
    @TableField("SUB_VALUE")
    private String subValue;

    /**
     * 学科类型
     */
    @TableField("SUB_TYPE")
    private Integer subType;

    /**
     * 备注
     */
    @TableField("REMARK")
    private String remark;

    /**
     * 英文
     */
    @TableField("ENG")
    private String eng;

    /**
     * 父级学科id
     */
    @TableField("PARENT_SUB_ID")
    private Long parentSubId;

    public void createByWos(Long parentSubId,String subName) {
        this.subCode = null;
        this.subValue = subName;
        this.subType = 2;
        this.remark = null;
        this.eng = null;
        this.parentSubId = parentSubId;
    }

    public void create(String subCode, String subValue, Integer subType, String remark, String eng, Long parentSubId) {
        this.subCode = subCode;
        this.subValue = subValue;
        this.subType = subType;
        this.remark = remark;
        this.eng = eng;
        this.parentSubId = parentSubId;
    }
}
